package com.eos.control.action.customer;

import java.util.List;

import com.eos.business.service.SysProductBusinessService;
import com.eos.common.tool.ConstantTool;
import com.eos.control.action.base.AbstractBaseAction;
import com.eos.orm.mybatis.model.ProductBrand;
import com.eos.orm.mybatis.model.SysProduct;

public class EditBrandAction extends AbstractBaseAction {
	private static final long serialVersionUID = -8338112939873714218L;
	private Integer brandId;
	private ProductBrand brand;
	private List<SysProduct> productList;
	
	public void setBrandId(Integer brandId) {
		this.brandId = brandId;
	}
	
	public ProductBrand getBrand() {
		return brand;
	}

	public List<SysProduct> getProductList() {
		return productList;
	}

	@Override
	public String execute() {
		try{
			SysProductBusinessService spbs = new SysProductBusinessService();
			brand = spbs.getProductBrandPrimaryKey(brandId);
			SysProduct pro = new SysProduct();
			pro.setDealFlag(ConstantTool.DEAL_FALG_OK);
			pro.setStatus(ConstantTool.STATUS_OK);
			productList = spbs.getSysProductExample(pro);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}
}
